{extend name="public:_base" /}
{block name="js"}
{include file="public/_validform"}
<!-- 配置文件 -->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.all.js"></script>

<script>
    $("[name='pid']").find("[value='{$data.pid ?? ''}']").attr("selected", true);
    $('#pid').change(function(){
        var ss = $(this).children('option:selected').attr('id');
        $('#pids').attr('value', ss);
    });
    var ue = UE.getEditor('editor');

</script>
{/block}
{block name="main"}
<div class="page-container">

    <form action="{:url('Nav/save')}" method="post" class="form form-horizontal" id="form">
        
        <table class="table table-border table-bordered table-bg mt-20">
            <thead>
                <tr>
                    <th colspan="2" scope="col">填写信息</th>
                </tr>
            </thead>
            
            <tbody>
                <tr>
                    <th>
                        <span class="c-red">*</span>导航级别：
                    </th>
                    <td>
                        <span class="select-box">
                            <select name="pid" id="pid" class="select">
                                <option value="0" id=",">一级</option>
                                {volist name="getall" id="vo"}
                                <option value="{$vo.id}"  id="{$vo.pids}">{$vo['level']}{$vo.name}</option>
                                {/volist}
                            </select>
                        </span>
                    </td>
                </tr>
                
                <tr>
                    <th>
                        <span class="c-red">*</span>导航名：
                    </th>
                    <td>
                        <input type="text" class="input-text" value="{$data.name ?? ''}" placeholder="" datatype="*" name="name">
                    </td>
                </tr>
                
                <tr>
                    <th>
                        <span class="c-red">*</span>英文名：
                    </th>
                    <td>
                        <input type="text" class="input-text" value="{$data.Ename ?? ''}" placeholder="" datatype="*" name="Ename">
                    </td>
                </tr>
                
                <tr style="display: none">
                    <th>
                        <span class="c-red">*</span>单页面模板：
                    </th>
                    <td>
                        <input type="text" class="input-text" value="{$data.temppage ?? 'page.html'}" placeholder="" datatype="*" name="temppage">
                    </td>
                </tr>
                
                <tr style="display: none">
                    <th>
                        内容：
                    </th>
                    <td>
                        <script id="editor" type="text/plain" name="content" style="width:100%;height:400px;">{$data.content|default=''|html_entity_decode ?? ''}</script>
                    </td>
                </tr>
            </tbody>
            
            <tfoot>
                <tr>
                    <th></th>
                    <td>
                        <input name="id" value="{$data.id ?? ''}" type="hidden">
                        <input name="type" value="one" type="hidden">
                        <input name="model" value="about" type="hidden">
                            <input id="pids" name="pids" value="{$data.pids ?? ','}" type="hidden">
                        {:token()}
                        <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                    </td>
                </tr>
            </tfoot>
            
        </table>

    </form>
    
</div>
{/block}
